package dao.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "listen", catalog = "makeiteasy")
public class Listen implements java.io.Serializable {

	// Fields
	private static final long serialVersionUID = 1L;
	private Integer listenId;
	private String listenDirection;
	private String listenPassge;
	private String listenKeys;
	private Set<Test> tests = new HashSet<Test>(0);

	// Constructors

	/** default constructor */
	public Listen() {
	}

	/** full constructor */
	public Listen(String listenDirection, String listenPassge, 
			String listenKeys, Set<Test> tests) {
		this.listenDirection = listenDirection;
		this.listenPassge = listenPassge;
		this.listenKeys = listenKeys;
		this.tests = tests;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "listenId", unique = true, nullable = false)
	public Integer getListenId() {
		return this.listenId;
	}

	public void setListenId(Integer listenId) {
		this.listenId = listenId;
	}

	@Column(name = "listenDirection", length = 256)
	public String getListenDirection() {
		return this.listenDirection;
	}

	public void setListenDirection(String listenDirection) {
		this.listenDirection = listenDirection;
	}

	@Column(name = "listenPassge", length = 2048)
	public String getListenPassge() {
		return this.listenPassge;
	}

	public void setListenPassge(String listenPassge) {
		this.listenPassge = listenPassge;
	}

	@Column(name = "listenKeys", length = 256)
	public String getListenKeys() {
		return this.listenKeys;
	}

	public void setListenKeys(String listenKeys) {
		this.listenKeys = listenKeys;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "listen")
	public Set<Test> getTests() {
		return this.tests;
	}

	public void setTests(Set<Test> tests) {
		this.tests = tests;
	}

}